Postfix + Clamav + Amavisd
2015/11/25 |
onfigure Virus-Scanning with Postfix + Clamav + Amavisd.
|
|
[1] | |
[2] | Install Amavisd, and start Clamav Server. |
mail:~ #
mail:~ # zypper -n install amavisd-new spamassassin systemctl start clamd mail:~ # systemctl enable clamd |
[3] | Configure and start Amavisd. |
mail:~ #
vi /etc/amavisd.conf # line 20: change to own domain name $mydomain = ' srv.world ';
# line 149: uncomment and change to own hostname $myhostname = ' mail.srv.world ';
# line 151,152: uncomment $notify_method = 'smtp:[127.0.0.1]:10025'; $forward_method = 'smtp:[127.0.0.1]:10025'; sa-update mail:~ # systemctl start amavis spamd mail:~ # systemctl enable amavis spamd |
[4] | Configure Postfix. |
mail:~ #
vi /etc/postfix/main.cf # line 668: add content_filter = smtp-amavis:[127.0.0.1]:10024
mail:~ #
vi /etc/postfix/master.cf # add follows to the end smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes 127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 systemctl restart postfix |
[5] | It' OK all. These lines below are added in the header section of emails after this configuration and emails with known Virus will not sent to Clients. |